import QtQuick 1.1
//import com.nokia.symbian 1.1
import com.nokia.meego 1.0

Item {
    id: viewHeader
    width: parent.width
    height: headerBackground.height
    property alias content: titleBar.children
    property alias pressed: mouseArea.pressed
    property Style platformStyle: ViewHeaderStyle {}
    property alias clickable: mouseArea.enabled

    signal clicked

    BorderImage {
        id: headerBackground
        border {
            left: platformStyle.headerBackgroundMarginLeft
            right: platformStyle.headerBackgroundMarginRight
            top: platformStyle.headerBackgroundMarginTop
            bottom: platformStyle.headerBackgroundMarginBottom
        }
        source: pressed ? platformStyle.headerBackgroundPressed : platformStyle.headerBackground
        width: parent.width
        height: (screen.currentOrientation == Screen.Portrait || screen.currentOrientation == Screen.PortraitInverted) ? visual.headerHeightPortrait : visual.headerHeightLandscape
    }

    Item {
        id: titleBar
        anchors.fill: parent
        anchors.verticalCenter: parent.verticalCenter
        anchors.leftMargin: platformStyle.margin
        anchors.rightMargin: platformStyle.margin
    }

    MouseArea {
        id: mouseArea
        anchors.fill: parent
    }

    Component.onCompleted: mouseArea.clicked.connect(clicked)
}
